import request from '@/utils/request'
// src/api/chapters.js



/*ai续写
 ** request ** (body)
  - ** ai_tool_id ** (string, required): AI工具ID，表示使用的具体AI工具。
  - ** creation_id ** (uint64, required): 作品ID，用于标识作品，必填字段。
  - ** model ** (string, optional): 使用的模型名称（如GPT - 3、GPT - 4等）。
  - ** context ** (string, optional): 用户提出的具体问题或上下文，新增字段，用于直接启动对话时的用户提问。
  - ** goals ** (string, optional): 用户的目标，新增字段，用于直接启动对话时的目标描述。
  */
//流式接口续写
export function conversationAiWrite (data) {
  return request({
    url: "/api/v1/conversation/stream_text",
    method: "POST",
    data,
    timeout: 200000
  });
}
//停止流式输出
export function conversationAiStop (data) {
  return request({
    url: "/api/v1/conversation/stop_stream_text",
    method: "POST",
    data
  })
}
//非流式接口续写
export function conversationAiWrite2 (data) {
  return request({
    url: "/api/v1/conversation/context ",
    method: "POST",
    data
  })
}


export function conversationBuild (data) {
  return request({
    url: "/api/v1/conversation/build",
    method: "POST",
    data
  });
}
export function conversationCreate (data) {
  return request({
    url: "/api/v1/conversation/create",
    method: "POST",
    data
  });
}
// 1. 创建章节
export function conversationList (data) {
  return request({
    url: "/api/v1/conversation/list",
    method: "POST",
    data
  });
}

export function conversationDetail (data) {
  return request({
    url: "/api/v1/conversation/detail",
    method: "POST",
    data
  });
}

export function conversationSend (data) {
  return request({
    url: "/api/v1/conversation/send_message",
    method: "POST",
    data
  });
}

export function conversationUpTitle (data) {
  return request({
    url: "/api/v1/conversation/update_title",
    method: "POST",
    data
  });
}

export function conversationDelete (data) {
  return request({
    url: "/api/v1/conversation/delete",
    method: "POST",
    data
  });
}
